#!/usr/bin/python

import sys
from Bio import SeqIO

sf = open(sys.argv[1], "rU")

record = SeqIO.read(sf, "fasta")

start = raw_input("Enter start: ")

stop = raw_input("Enter stop: ")

strand = raw_input("Enter strand (+ or -): ")

if strand == "+":
    print record.seq[int(start):int(stop)]
else:
    print record.seq[int(start):int(stop)].reverse_complement()


